<table>
<?php
$_DBSite = "Master";
include($_SERVER["DOCUMENT_ROOT"]."/db.inc.php");

$strSQL = "SHOW TABLE Status";
$RS = mysql_query($strSQL);
while($Rows = mysql_fetch_object($RS)){
	?>
<tr>
	<td colspan="6"><?php print $Rows -> Name;?>&nbsp;<?php print $Rows -> Comment;?></td>
</tr>
<tr>
	<td>欄位</td>
	<td>型態</td>
	<td>Null</td>
	<td>預設值</td>
	<td>附加</td>
	<td>key</td>
</tr>
	<?php
	$strSQL = "SHOW COLUMNS from ".$Rows -> Name;
	$RSS = mysql_query($strSQL);
	while($Rowss = mysql_fetch_array($RSS, MYSQL_ASSOC)){
		?>
<tr>
	<td><?php print $Rowss["Field"];?></td>
	<td><?php print $Rowss["Type"];?></td>
	<td>否</td>
	<td><?php print $Rowss["Default"];?></td>
	<td><?php print $Rowss["Extra"];?></td>
	<td><?php print $Rowss["key"];?></td>
</tr>
		<?php
	}
	?>
<tr>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>索引</td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>鍵名</td>
	<td>是否重複</td>
	<td>欄位</td>
	<td></td>
	<td></td>
	<td></td>
</tr>
	<?php
	//Index
	$strSQL = "SHOW INDEX from ".$Rows -> Name;
	$RSS = mysql_query($strSQL);
	while($Rowss = mysql_fetch_array($RSS, MYSQL_ASSOC)){
		?>
<tr>
	<td><?php print $Rowss["Key_name"];?></td>
	<td><?php print ($Rowss["Non_unique"] == 0)?"否":"是";?></td>
	<td><?php print $Rowss["Column_name"];?></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
		<?php
	}
	?>
<tr>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
	<td></td>
</tr>
	<?php
}
?>
</table>